#!/bin/bash

# 输入法设置文件
input_xml_des_path="/usr/share/glib-2.0/schemas/com.github.libpinyin.ibus-libpinyin.gschema.xml"
input_xml_source_path="/usr/local/bin/com.github.libpinyin.ibus-libpinyin.gschema.xml"


# 检查文件是否存在
if [ -f "$input_xml_source_path" ]; then
    echo "文件存在: $input_xml_source_path"
    echo 1|sudo -S rm  -rf "$input_xml_des_path"
    echo 1|sudo -S mv "$input_xml_source_path" "$input_xml_des_path"

    # 检查移动是否成功
    if [ $? -eq 0 ]; then
        echo "文件已移动到: $input_xml_des_path"
    else
        echo "文件移动失败。"
    fi
else
    echo "文件不存在: $input_xml_source_path"
fi

# 清除配置缓存
# rm -rf /home/bj/.cache/ibus
# rm -rf /home/bj/.config/dconf/user
# echo 1|sudo -S glib-compile-schemas /usr/share/glib-2.0/schemas/
# ibus restart

